package com.coderman.daoclient.dao.impl;

import com.coderman.daoclient.bean.KVPair;
import com.coderman.daoclient.connections.StatementTask;
import com.coderman.daoclient.dao.IDao;

import java.util.ArrayList;
import java.util.List;
import java.util.Map;

/**
 * Created by ${fanchunshuai} on 2017-7-26.
 *
 * @version: V1.0
 * @Desc:
 * @Copyright (c) 2017 58到家-版权所有
 */
public class IDaoImpl<T,Key> extends StatementTask implements IDao {

    @Override
    public Long insertEntity(Object o) throws Exception {
        return super.exeInsert(o);
    }

    @Override
    public void updateEntity(Object o) throws Exception {
        super.exeUpdate(o);
    }

    @Override
    public void deleteEntity(Class aClass, Object type) throws Exception {
        super.exeDelete(aClass, type);
    }

    @Override
    public Object getById(Class aClass, Object type) throws Exception {
        return super.exeQueryTID(aClass, type);
    }

    @Override
    public List getList(Class aClass) throws Exception {
        return super.getList(aClass, new ArrayList<KVPair>());
    }

    @Override
    public List getList(Class aClass,String sql) throws Exception {
        return super.getList(aClass, sql);
    }


    @Override
    public List getList(Class clazz, List list) throws Exception {
        return super.getList(clazz, list);
    }
    @Override
    public Map<String, String> getMap(Class clazzBean, String keyColumn, String valueColumn) throws Exception {
        return super.getMap(clazzBean, keyColumn, valueColumn);
    }

    @Override
    public void updateEntity(Class clazz, List list, KVPair idPair) throws Exception {
        super.exeUpdate(clazz, list, idPair);
    }
}